<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src= "jquery-3.6.0.min.js"></script>
		<script>
			$(function(){
				var url= "http://localhost:8090/getUser"
				var name = "张三"
				var age = 18
				var args1 = "name="+name+"&age="+age
				var args2 = {name:name,age:age}
				$.get(url,function(data){
					console.log(data)
					// for(var index in data){
					// 	console.log(data[index])
					// }
					for (var user of data){
						var id = user.id
						var name = user.name 
						var age = user.age
						var sex = user.sex
var tr = "<tr align = 'center'><td>"+id+"</td><td>"+name+"</td><td>"+age+"</td><td>"+sex+"</td></tr>"
					$("#tab1").append(tr)
					}
				})
			})
		</script>
	</head>
	<body>
		<table id = "tab1" border="1px" width="700px" align="center">
		<tr><td colspan="4" align="center"><h1>表格数据</h1></td></tr>	
		<tr align="center">
			<td>ID编号</td>
			<td>名称</td>
			<td>年龄</td>
			<td>性别</td>
		</tr>
		</table>
	</body>
</html>
